package com.charles.seckillData.feignService;

import com.charles.seckillData.domain.SysUser;
import com.charles.seckillData.feignFallBack.RemoteUserFallbackFactory;
import com.charles.seckillData.model.UserLogin;
import com.charles.seckillComponentCommon.constants.RoleConstants;
import com.charles.seckillComponentCommon.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author Charels-H
 * 
 * 远程调用客户业务
 */
@FeignClient(contextId = "remoteUserService", value = "seckillPlatform", fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {

    /**
     * 通过身份证号码查询客户信息
     * 
     * @return 内部调用 R<> 响应体
     */
    @GetMapping("/user/info/{userCard}")
    R<UserLogin> queryUserInfoByUserCard(@PathVariable("userCard") String userCard, @RequestHeader(RoleConstants.FROM_SOURCE) String source);
    
    /**
     * 注册客户
     *
     * @return 内部调用 R<> 响应体
     */
    @PostMapping("/user/register")
    R<Boolean> registerUser(@RequestBody SysUser sysUser, @RequestHeader(RoleConstants.FROM_SOURCE) String source);

}
